package javaMSCRM;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.Insets;

import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;

/**
 * @author Zoran IVANOV
 *
 */
public class StatusBar extends JPanel {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	JavaMSCRM JavaMSCRM = null;
	
	/**
	 * @author Zoran IVANOV
	 *
	 */
	public class JavaMSCRMStatusBarButton extends JButton {
		private static final long serialVersionUID = 1L;
		public JavaMSCRMStatusBarButton(String label) {
			setText(label);
			setFont(new Font("Arial", Font.PLAIN, 11));
			setPreferredSize(new Dimension(20, 18));
			setMargin(new Insets(0,0,0,0));
		}
	}
	
	/**
	 * @param JavaMSCRM
	 */
	public StatusBar(JavaMSCRM JavaMSCRM) {
		this.JavaMSCRM = JavaMSCRM;
		
		setLayout(new BorderLayout(0,0));
		JavaMSCRM.LettersContainer = new JPanel();
		
		JavaMSCRM.ButtonAll = new JavaMSCRMStatusBarButton("All");
		JavaMSCRM.ButtonA = new JavaMSCRMStatusBarButton("A");
		JavaMSCRM.ButtonB = new JavaMSCRMStatusBarButton("B");
		JavaMSCRM.ButtonC = new JavaMSCRMStatusBarButton("C");
		JavaMSCRM.ButtonD = new JavaMSCRMStatusBarButton("D");
		JavaMSCRM.ButtonE = new JavaMSCRMStatusBarButton("E");
		JavaMSCRM.ButtonF = new JavaMSCRMStatusBarButton("F");
		JavaMSCRM.ButtonG = new JavaMSCRMStatusBarButton("G");
		JavaMSCRM.ButtonH = new JavaMSCRMStatusBarButton("H");
		JavaMSCRM.ButtonI = new JavaMSCRMStatusBarButton("I");
		JavaMSCRM.ButtonJ = new JavaMSCRMStatusBarButton("J");
		JavaMSCRM.ButtonK = new JavaMSCRMStatusBarButton("K");
		JavaMSCRM.ButtonL = new JavaMSCRMStatusBarButton("L");
		JavaMSCRM.ButtonM = new JavaMSCRMStatusBarButton("M");
		JavaMSCRM.ButtonN = new JavaMSCRMStatusBarButton("N");
		JavaMSCRM.ButtonO = new JavaMSCRMStatusBarButton("O");
		JavaMSCRM.ButtonP = new JavaMSCRMStatusBarButton("P");
		JavaMSCRM.ButtonQ = new JavaMSCRMStatusBarButton("Q");
		JavaMSCRM.ButtonR = new JavaMSCRMStatusBarButton("R");
		JavaMSCRM.ButtonS = new JavaMSCRMStatusBarButton("S");
		JavaMSCRM.ButtonT = new JavaMSCRMStatusBarButton("T");
		JavaMSCRM.ButtonU = new JavaMSCRMStatusBarButton("U");
		JavaMSCRM.ButtonV = new JavaMSCRMStatusBarButton("V");
		JavaMSCRM.ButtonW = new JavaMSCRMStatusBarButton("W");
		JavaMSCRM.ButtonX = new JavaMSCRMStatusBarButton("X");
		JavaMSCRM.ButtonY = new JavaMSCRMStatusBarButton("Y");
		JavaMSCRM.ButtonZ = new JavaMSCRMStatusBarButton("Z");
		
		JavaMSCRM.LettersContainer.add(JavaMSCRM.ButtonAll);
		JavaMSCRM.LettersContainer.add(JavaMSCRM.ButtonA);
		JavaMSCRM.LettersContainer.add(JavaMSCRM.ButtonB);
		JavaMSCRM.LettersContainer.add(JavaMSCRM.ButtonC);
		JavaMSCRM.LettersContainer.add(JavaMSCRM.ButtonD);
		JavaMSCRM.LettersContainer.add(JavaMSCRM.ButtonE);
		JavaMSCRM.LettersContainer.add(JavaMSCRM.ButtonF);
		JavaMSCRM.LettersContainer.add(JavaMSCRM.ButtonG);
		JavaMSCRM.LettersContainer.add(JavaMSCRM.ButtonH);
		JavaMSCRM.LettersContainer.add(JavaMSCRM.ButtonI);
		JavaMSCRM.LettersContainer.add(JavaMSCRM.ButtonJ);
		JavaMSCRM.LettersContainer.add(JavaMSCRM.ButtonK);		
		JavaMSCRM.LettersContainer.add(JavaMSCRM.ButtonL);
		JavaMSCRM.LettersContainer.add(JavaMSCRM.ButtonM);
		JavaMSCRM.LettersContainer.add(JavaMSCRM.ButtonN);
		JavaMSCRM.LettersContainer.add(JavaMSCRM.ButtonO);		
		JavaMSCRM.LettersContainer.add(JavaMSCRM.ButtonP);
		JavaMSCRM.LettersContainer.add(JavaMSCRM.ButtonQ);
		JavaMSCRM.LettersContainer.add(JavaMSCRM.ButtonR);
		JavaMSCRM.LettersContainer.add(JavaMSCRM.ButtonS);
		JavaMSCRM.LettersContainer.add(JavaMSCRM.ButtonT);
		JavaMSCRM.LettersContainer.add(JavaMSCRM.ButtonU);
		JavaMSCRM.LettersContainer.add(JavaMSCRM.ButtonV);
		JavaMSCRM.LettersContainer.add(JavaMSCRM.ButtonW);
		JavaMSCRM.LettersContainer.add(JavaMSCRM.ButtonX);
		JavaMSCRM.LettersContainer.add(JavaMSCRM.ButtonY);
		JavaMSCRM.LettersContainer.add(JavaMSCRM.ButtonZ);
		
		add(JavaMSCRM.LettersContainer, BorderLayout.LINE_START);
		
		JavaMSCRM.PreviousPage = new JavaMSCRMStatusBarButton("<");
		JavaMSCRM.PreviousPage.setVisible(false);
		JavaMSCRM.PageNumber = new JLabel("");
		JavaMSCRM.NextPage = new JavaMSCRMStatusBarButton(">");
		JavaMSCRM.NextPage.setVisible(false);
		setPreferredSize(new Dimension(200, 28));
		JavaMSCRM.PagingContainer = new JPanel();
		JavaMSCRM.PagingContainer.add(JavaMSCRM.PreviousPage);
		JavaMSCRM.PagingContainer.add(JavaMSCRM.PageNumber);
		JavaMSCRM.PagingContainer.add(JavaMSCRM.NextPage);
		add(JavaMSCRM.PagingContainer, BorderLayout.LINE_END);
	}
}
